<?php
error_reporting(0);
include 'admin/conn/conn.php';
include 'submitemail.php';

$request= $_REQUEST["RequestType"];
$name= $_REQUEST["realname"];
$email= $_REQUEST["email"];
$address =$_REQUEST["address"];
$city =$_REQUEST["city"];
$country =$_REQUEST["Country"];
$Province=$_REQUEST["Province"];
$PostalCode=$_REQUEST["PostalCode"];
$Phone=$_REQUEST["Phone"];
$message=$_REQUEST["Message"];

$mailTo = "das.sayan@techbridge.co.in";

/*SUBJECT & BODY OF THE EMAIL*/
$subject = ucfirst($name)." has requested for contacting us";


$comment = "";
$comment .=" First Name: ".ucfirst($name);
$comment .="\n";
$comment .="Address: ".ucfirst($address);
$comment .="\n";
$comment .="Email Address: ".ucfirst($email);
$comment .="\n";
$comment .="Contact No : ".ucfirst($Phone);
$comment .="\n";
$comment .="PostalCode : ".ucfirst($PostalCode);
$comment .="\n";
$comment .="city : ".ucfirst($city);
$comment .="\n";
$comment .="Message : ".ucfirst($message);
$comment .="\n";
/*  ENDS */


$sqlDonate="insert into tbl_contact_request(request,name,email,address,city,country,province,postalcode,phone,message,is_answered) values('$request','$name','$email','$address','$city ','$country','$Province','$PostalCode','$Phone','$message','y')";
$run = mysql_query($sqlDonate);

if($run)
{

	GENERATE_SMTP_MAIL($mailTo,$email,$name,'','',$subject,$comment);
	header("Location:contactus.php?msg=success");
}
else
{
	header("Location:contactus.php?msg=failure");
}
?>